from base import StringBuffer

def render(formcls, tabcls):
    _ = StringBuffer()
    _('''<span class="%s_bar tabbar">'''%formcls)
    index = 0
    for tag, cls in tabcls:
        _('''<a href="javascript:;" class="%s_btn %s" onclick="tabform_sel(this, '%s', '%s')">%s</a>'''%(cls, index == 0 and 'sel_btn' or '', formcls, cls, tag))    
        index+=1
    _('''</span>''')
    return _.getvalue()